from django.contrib import admin
from myApp.models import JobInfo,User,Collection
# Register your models here.

class JobManager(admin.ModelAdmin):
    list_display = ['id','title', 'address', 'type', 'educational', 'workExperience', 'workTag',
                                 'salary', 'salaryMonth', 'companyTags', 'hrWork', 'hrName', 'internship',
                                 'companyTitle','companyAvatar', 'companyNature', 'companyStatus',
                                 'companyPeople','detailUrl', 'companyUrl', 'dist']
    list_display_links = ['title']
    list_filter = ['type']
    search_fields = ['title']
    readonly_fields = ['id']
    list_per_page = 20
    date_hierarchy = 'createTime'

class UserManager(admin.ModelAdmin):
    list_display = ['id','username', 'password', 'avatar','educational','workExperience', 'work','address','createTime']
    list_display_links = ['username']
    search_fields = ['username']
    readonly_fields = ['id']
    list_per_page = 20

class CollectionManager(admin.ModelAdmin):
    list_display = ['id','job','user','count']

admin.site.register(JobInfo,JobManager)
admin.site.register(User,UserManager)
admin.site.register(Collection,CollectionManager)